package ml.evaluation;

import java.util.List;

import ml.UpAndCountDownLatch;
import weka.classifiers.lazy.IBk;
import weka.core.Instances;

public class IBkClassification extends EvaluationRunnable {

	private final int kNN;

	public IBkClassification(UpAndCountDownLatch latch, Instances trainingData,
			Instances testData, List<EvaluationResult> results, int kNN) {
		super(latch, trainingData, testData, results);
		this.kNN = kNN;
	}

	@Override
	public EvaluationResult evaluate() throws Exception {
		System.out.println("Execution of IBk (" + kNN
				+ "NN) classification evaluation started ...");
		IBk ibk = new IBk();
		ibk.setKNN(kNN);
		return evaluateOnTestData(ibk);
	}
}
